<%@ Control Language="VB" AutoEventWireup="false" CodeFile="AddEnlist.ascx.vb" Inherits="WebForm_SelfManageEnlistment_AddEnlist" %>
<%@ Register Namespace="My" TagPrefix="cc1" %>
<My:MyGridView ID="gv" runat="server" SkinID="pager" AllowHoverSelect="False"
    AllowHoverEffect="True" MySortDirection="Ascending" DataSourceID="SqlDataSource1" AutoGenerateColumns="False" DataKeyNames="EnlistID" AllowSorting="True">
    <Columns>
        <asp:TemplateField>
        <headertemplate>
            <asp:Button id="btnGetIn" runat="server" meta:resourcekey="btnGetIn" CommandArgument="btnGetIn"></asp:Button>
        
</headertemplate>
        <ItemTemplate>
        <asp:CheckBox ID="chkGetIn" runat="server"></asp:CheckBox>
        <asp:HiddenField runat="server" ID="hideEnlistID" value='<%# Eval("EnlistID") %>'></asp:HiddenField>
        
</ItemTemplate>
        <ItemStyle HorizontalAlign="Center" />
        </asp:TemplateField>
        <asp:BoundField DataField="OrganizationName" meta:resourcekey="bfOrganizationName" SortExpression="OrganizationName" > 
        <HeaderStyle Width="100px" /><ItemStyle Width="100px" />
                </asp:BoundField>
        <asp:BoundField DataField="EnlistName" meta:resourcekey="bfEnlistName" SortExpression="EnlistName" > 
        <HeaderStyle Width="120px" /><ItemStyle Width="120px" />
                </asp:BoundField>
        <asp:BoundField DataField="Description" meta:resourcekey="bfDescription" SortExpression="Description"> 
        <HeaderStyle Width="120px" /><ItemStyle Width="120px" />
                </asp:BoundField>
        <asp:BoundField DataField="StartDate" meta:resourcekey="bfStartDate" SortExpression="StartDate" DataFormatString="{0:yyyy/MM/dd}" ><ItemStyle HorizontalAlign="Center" /> </asp:BoundField>
        <asp:BoundField DataField="EndDate" meta:resourcekey="bfEndDate" SortExpression="EndDate" DataFormatString="{0:yyyy/MM/dd}" ><ItemStyle HorizontalAlign="Center" /> </asp:BoundField>
        <asp:BoundField DataField="PeopleRequired" meta:resourcekey="bfPeopleRequired" SortExpression="PeopleRequired" ><ItemStyle HorizontalAlign="Center" /> </asp:BoundField>
    </Columns>
</My:MyGridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:connStr %>" SelectCommand="Select a.*,b.OrganizationName from EnlistHeader a&#13;&#10;Join organizationview b on a.UOrganizationID=b.UOrganizationID&#13;&#10;where a.EnlistID not in&#13;&#10;(&#13;&#10;&#9;select EnlistID from EnlistRecordApplication&#13;&#10;&#9;where VolunteerID=@VolunteerID&#13;&#10;&#9;&#9;and Status not in ('RW') &#13;&#10;)&#13;&#10;and Getdate() between a.StartDate and a.EndDate">
    <SelectParameters>
        <asp:Parameter Name="VolunteerID" Type="String" />
    </SelectParameters>
</asp:SqlDataSource>
